package com.sv.zgydor.service.impl;

import com.sv.zgydor.dao.Table1DAO;
import com.sv.zgydor.pojo.pg.Table1Entity;
import com.sv.zgydor.service.Table1Service;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;

import javax.transaction.Transaction;
import java.util.List;

/**
 * Class summary
 * User: kevin
 * Date: 2017/09/23
 * Time: 21:23
 * Description:
 */
@Service
public class Table1ServiceImpl implements Table1Service{

    @Autowired
    private Table1DAO table1DAO;

    @Override
    @Transactional
    public void save(Table1Entity table1Entity) {
        this.table1DAO.save(table1Entity);
    }

    @Override
    @Transactional
    public List<Table1Entity> findAll() {
        return this.table1DAO.findAll();
    }
}
